package com.probiz.estore.customer.dao;

import java.util.List;

import com.probiz.estore.common.model.customer.Favorite;
import com.probiz.estore.common.model.customer.FavoriteProduct;
import com.probiz.estore.core.dao.GenericDao;

public interface FavoriteDao extends GenericDao<Favorite> {
	
	/**
	 * shortcut to add favorite
	 * @param appuserId
	 * @param itemId
	 * @param type
	 */
	public void addFavorite(Integer appuserId, Integer itemId, Short type);
	
	/**
	 * retrieve list of favorite by appuserId
	 * @param appuserId
	 * @return
	 */
	public List<Favorite> getFavorites(Integer appuserId);
	
	/**
	 * retrieve list of favorite product by appuserId
	 * @param AppuserId
	 * @return
	 */
	public List<FavoriteProduct> getFavoriteProducts(Integer appuserId);
	
	//删除所有与特定产品相关的收藏
	public void deleteFavoriteProducts(Integer productId);
	
	/**
	 * 用户收藏夹
	 * @param appuserId 用户ID
	 * @param maxSize 最大个数
	 * @return
	 */
	public List<Favorite> getFavoritesByCustomer(Integer appuserId, Integer maxSize);
	
	/**
	 * 根据appuserId获取该用户的商品收藏数
	 * @param appuserId
	 * @return
	 */
	public long countCustomerFavorite(Integer appuserId);
}